#ifndef IBE_OBJECT_READER_H_
#define IBE_OBJECT_READER_H_

#include "IBE_Common_Export.h"
#include "IBE_Object.h"

namespace ibe_common
{
    class IBE_DataInformation;
    /**
     * @class IBE_ObjectReader
     * @brief 读取文件，并用IBE_DataInformation存储数据信息
     * @author liupeng
     */
    class IBE_COMMON_EXPORT IBE_ObjectReader : public ibe_common::IBE_Object
    {
    public:
        IBE_TypeMacro( ibe_common, IBE_ObjectReader, ibe_common, IBE_Object );

        //@{
        /**
          * @brief 设置输入文件路径
          *
          * @param file_name 文件路径
          */
        virtual void SetFileName( const char* file_name );
        /**
          * @brief 获取输入文件路径
          * @return 文件路径
          */
        virtual const char* GetFileName()
        {
            return this->fileName_.c_str();
        }
        //@}

        /**
          * @brief 读取文件
          */
        virtual void Update();

        /**
         * @brief 转换后的数据信息
         *
         * @return 数据信息
         */
        virtual ibe_common::IBE_DataInformation* GetDataInformation();

    protected:
        explicit IBE_ObjectReader( const char* file_name = "" );
        ~IBE_ObjectReader();

        virtual void Initialize() override;
        virtual void InitData();

    protected:
        std::string fileName_; //!< 读入文件路径
        //! 读取文件的数据信息
        ibe_common::IBE_DataInformation* dataInfo_;

    private:
        IBE_ObjectReader( const IBE_ObjectReader& ) = delete;
        IBE_ObjectReader& operator=( const IBE_ObjectReader& ) = delete;
    };

} // namespace ibe_ansys

#endif // IBE_OBJECT_READER_H_